package com.yanqu.road.server.timer;

import com.yanqu.road.server.manager.log.CrossCenter2LogMgr;
import com.yanqu.road.utils.executor.GeneralTask;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * @Description
 * @Author cwq
 * @Data 2022/1/5 15:52
 */
public class LogDataSaveCrossCenter2Task extends GeneralTask {

    private static Logger logger = LogManager.getLogger(LogDataSaveCrossCenter2Task.class);
    private static boolean running = false;

    @Override
    public void doRun() {
        if (!running) {
            running = true;
            try {
                CrossCenter2LogMgr.save();
            } catch (Exception e) {
                logger.error("save LogDataSaveTask error. ",e);
            }finally {
                running = false;
            }
        }
    }
}
